class RankItem extends eui.ItemRenderer
{
	public icon:eui.Image;
	public nameLabel:eui.Label;
	public rankLabel:eui.Label;
	public leverLabel:eui.Label;
	public scoreLabel:eui.Label;
	public bg:eui.Image;
	public maskRect:eui.Rect;
	public line:eui.Rect;

    public constructor()
	{
        super();
		this.skinName = "resource/eui_skins/RankItemSkin.exml";
    }

	protected childrenCreated(): void 
    {
        super.childrenCreated();
		this.icon.mask=this.maskRect;
    }

    protected dataChanged():void
	{
		this.icon.source=this.data.headicon;
        
		var nicknames:string = this.data.nickname;
		if(nicknames.length>=9){
			nicknames = nicknames.substring(0,8)+'..';
		}
		this.nameLabel.text =  nicknames;
		if(this.data.rank>3){
			this.rankLabel.textColor=0x000000;
		}
		this.rankLabel.text = this.data.rank.toString();
		this.scoreLabel.text = this.data.source+"分";
		if(this.data.rank==utils.CoreData.instance.rankData.length)
		{
			this.line.visible=false;
		}
    }
}